<template>
	<view style="padding-top: 10rpx;">
		<view class="text-area">
			<text>输入值：</text><input type="text" v-model="title" style="color: red;background-color: #ddd;" />
		</view>
		<view class="text-area">
			<text>回传值：</text><input type="text" :value="allBackValue" style="color: yellow;background-color: #ddd;" />
		</view>
		<comA :intent="title"></comA>
		<comB @callBackFun="callBack"></comB>
	</view>
</template>

<script>
	import comA from '../../components/comA.vue';
	import comB from '../../components/comB.vue';
	export default {
		components: {
			comA,
			comB
		},
		data() {
			return {
				title: "",
				allBackValue: ""
			}
		},
		methods: {
			callBack(msg) {
				console.warn("-----index-----callBack--->" + msg);
				this.allBackValue = msg;
			}
		}
	}
</script>

<style>
	.text-area {
		display: flex;
		align-items: center;
		margin: 10rpx 0;
	}

	input {
		border: 1rpx solid #ccc;
		padding: 8rpx;
		border-radius: 4rpx;
	}
</style>